//
//  JSScrollCell.m
//  无限滚动
//
//  Created by Liekkas on 16/3/21.
//  Copyright © 2016年 Admin. All rights reserved.
//

#import "JSScrollCell.h"
#import "JSScroll.h"
@interface JSScrollCell ()

@property (nonatomic, weak) UIImageView *imageV;

@end
@implementation JSScrollCell

//- (UIImageView *)imageV
//{
//    if (!_imageV) {
//        UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 10, [UIScreen mainScreen].bounds.size.width, 150)];
//        
//        _imageV = imageV;
//        
//        [self.contentView addSubview:imageV];
//    }
//    
//    return _imageV;
//}


- (instancetype)initWithFrame:(CGRect)frame
{
    if (self == [super initWithFrame:frame]) {
        UIImageView *imageV = [[UIImageView alloc] init];
        
        [self.contentView addSubview:imageV];
        
        _imageV = imageV;
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    CGFloat viewX = 0;
    CGFloat viewY = 0;
    CGFloat viewW = 375;
    CGFloat viewH = 150;
    
    _imageV.frame = CGRectMake(viewX, viewY, viewW, viewH);
    
    //NSLog(@"%@", _scrollPicture);
}

//- (void)setScroll:(JSScroll *)scroll
//{
//    _scroll = scroll;
//    NSLog(@"%@", scroll);
//    
//    _scrollPicture.image = scroll;
//}

- (void)setScroll:(JSScroll *)scroll
{
    _scroll = scroll;
    
    _imageV = scroll.scrollV;
}
@end
